package cn.myschool.java79.test2;

import cn.myschool.java79.dao.StudentMapper;
import cn.myschool.java79.entity.Student;
import cn.myschool.java79.util.MybatisUtil;
import cn.myschool.java79.util.StrUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestGetStu9 {
    public static void main(String[] args) {
        SqlSession s= MybatisUtil.get();

        try {
            StudentMapper mapper = s.getMapper(StudentMapper.class);
            Student stu=new Student();
            stu.setGradeid(5L);
            stu.setFromcity("安庆");
            stu.setEnterdate(StrUtil.toDate("2022-4-12"));
            stu.setSname("刘瑾");
            int add = mapper.add(stu);
            System.out.println(add);
        }finally {
            MybatisUtil.close(s);
        }
    }
}
